﻿using SmartCity.Passport.API.Infrastructure;
using SmartCity.Passport.Infrastructure.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartCity.Passport.Infrastructure.Implements
{
    public class BaseRepository<T> : IBaseRepository<T> where T : class
    {
        private readonly DataDbContext context;
        /// <summary>
        /// 构建方法
        /// </summary>
        /// <param name="context">上下文</param>
        public BaseRepository(DataDbContext context)
        {
            this.context = context;
        }
        /// <summary>
        /// 获取全部
        /// </summary>
        /// <returns>返回集合</returns>
        public IQueryable<T> GetAll()
        {
            return context.Set<T>().AsQueryable();
        }
    }
}
